﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QPushButton>
#include <QSlider>
#include <QLabel>
#include <QListWidget>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void openFolder();
    void play();
    void pause();
    void stop();
    void next();
    void previous();
    void mute();
    void setVolume(int volume);
    void updatePosition(qint64 position);
    void setPosition(int position);
    void updateDuration(qint64 duration);

private:
    QMediaPlayer *player;
    QMediaPlaylist *playlist;
    QPushButton *openBtn;
    QPushButton *playButton;
    QPushButton *pauseButton;
    QPushButton *stopButton;
    QPushButton *nextButton;
    QPushButton *previousButton;
    QPushButton *muteButton;
    QSlider *volumeSlider;
    QSlider *positionSlider;
    QLabel *currentTimeLabel;
    QLabel *totalTimeLabel;
    QListWidget *playlistWidget;
};
#endif // MAINWINDOW_H
